from data_reader import *
import unittest

class DataReaderTest(unittest.TestCase):
    def testGetImages(self):
      images = DataReader.GetImages('training-9k.txt', -1)
      self.assertEquals(9000, len(images))
      self.assertEquals(5, images[0].label)
      self.assertEquals(59, images[0].pixels[1][5])
      self.assertEquals(59, images[0].pixels[1][6])
      self.assertEquals(5, images[0].pixels[2][4])
      self.assertEquals(127, images[0].pixels[2][5])
      self.assertEquals(138, images[0].pixels[2][6])
      self.assertEquals(14, len(images[0].pixels))
      self.assertEquals(14, len(images[0].pixels[0]))

if __name__ == '__main__':
    unittest.main()
